package cn.cool.domain.trade.adapter.repository;

import cn.cool.domain.trade.model.aggregate.GroupBuyOrderAggregate;
import cn.cool.domain.trade.model.aggregate.GroupBuyTeamSettlementAggregate;
import cn.cool.domain.trade.model.entity.GroupBuyActivityEntity;
import cn.cool.domain.trade.model.entity.GroupBuyTeamEntity;
import cn.cool.domain.trade.model.entity.MarketPayOrderEntity;
import cn.cool.domain.trade.model.entity.NotifyTaskEntity;
import cn.cool.domain.trade.model.valobj.GroupBuyProgressVO;

import java.util.List;

public interface ITradeRepository {

    MarketPayOrderEntity queryNoPayMarketPayOrderByOutTradeNo(String userId, String outTradeNo);

    GroupBuyProgressVO queryGroupBuyProgress(String teamId);

    MarketPayOrderEntity lockMarketPayOrder(GroupBuyOrderAggregate orderAggregate);

    GroupBuyActivityEntity queryGroupBuyActivityByActivityId(Long activityId);

    Integer queryOrderCountByActivityId(Long activityId, String userId);

    GroupBuyTeamEntity queryGroupBuyTeamByTeamId(String teamId);

    void settlementMarketPayOrder(GroupBuyTeamSettlementAggregate groupBuyTeamSettlementAggregate);

    boolean isSCBlackIntercept(String userId, String channel);

    List<NotifyTaskEntity> queryUnExecutedNotifyTaskList();

    List<NotifyTaskEntity> queryUnExecutedNotifyTaskList(String teamId);

    int updateNotifyTaskStateSuccess(String teamId);

    int updateNotifyTaskStateError(String teamId);

    int updateNotifyTaskStateRetry(String teamId);

    void lockMarketPayOrderLimit(String activityId, String goodsId);

    boolean lockMarketPayOrderDone(String activityId, String teamId);
}
